#include "drv_spi.h"
#include "stm32f4xx.h"
#include "drv_w25qxx.h"

uint16_t drv_w25qxx_readID(void)
{
	uint16_t w25qxx_id = 0 ;
	GPIO_ResetBits( GPIOB,GPIO_Pin_2) ;
	drv_spi_wdata(0x90) ;

	drv_spi_wdata(0x00) ;
	drv_spi_wdata(0x00) ;
	drv_spi_wdata(0x00) ;

	w25qxx_id = drv_spi_wdata(0xff) ;
	w25qxx_id = w25qxx_id << 8 ;
	w25qxx_id |= drv_spi_wdata(0xff) ;

	GPIO_SetBits(GPIOB, GPIO_Pin_2) ;
	return w25qxx_id ;
	
}
